<%--
    Document   : index
    Created on : Oct 25, 2009, 10:09:20 PM
    Author     : Phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page  import="java.sql.*" %>
<%@taglib  prefix="ajax" uri="http://ajaxtags.org/tags/ajax" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <jsp:include page="../header.jsp" />
        <link rel="stylesheet" href="../css/style.css" />
        <link rel="stylesheet" href="../css/front.css"  />

        <title>Themes</title>
    </head>


    <body bgcolor="#154978">
        <jsp:useBean id="Oject" class="DAO.DAOAdmin" scope="page" />
        <table width="1024" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
            <!--DWLayoutTable-->
            <tr>
                <td width="1024" height="157" valign="top" background="../images/Banner.jpg">

                </td>
            </tr>
            <tr>
                <td height="463" valign="top">
                    <table width="100%" border="0" cellpadding="2" cellspacing="2">
                        <!--DWLayoutTable-->
                        <tr>
                            <td height="28" colspan="2" valign="top" background="../images/top_button.gif">
                            </td>
                        </tr>
                        <tr>
                            <td width="150" height="537" valign="top">

                                <!-- MENU -->
                                <%@include file="menu.jsp" %>
                                <!--END MENU-->	</td>
                            <td width="858" align="center" valign="middle" bgcolor="#CCCCCC">
                                <div id="updateTest" >
                                <form action="include/actionAddTest.jsp" method="post">
                                    <table border="1">
                                        <thead>
                                            <tr>
                                                <th></th>
                                                <th></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td>SubID : </td>
                                                <td> <select name="subID">
                                                        <%
            ResultSet rs = Oject.selectSuject3();
            while (rs.next()) {
                                                        %>
                                                        <option value="<%=rs.getInt("subID")%>"><%=rs.getString("SubName")%></option>
                                                        <% }%>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Test Name : </td>
                                                <td><input type="text" name="TestName"></td>
                                            </tr>
                                            <tr>
                                                <td>Test Time : </td>
                                                <td><input type="text" name="TimeTest"></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <input type="submit" value="Add TestQuestion" />
                                </form>
                                <!-- The End-->
                                </div>
                                <table border="1">
                                    <thead>
                                        <tr>
                                            <th>TestID</th>
                                            <th>SubID</th>
                                            <th>TestName</th>
                                            <th>TestTime</th>
                                            <th>Status</th>
                                            <th>Edit</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <%
            ResultSet rss = Oject.selectTest();
            while (rss.next()) {
                                        %>
                                        <tr>
                                            <td><%=rss.getString(1)%></td>
                                            <td><%=rss.getString(2)%></td>
                                            <td><%=rss.getString(3)%></td>
                                            <td><%=rss.getString(4)%></td>
                                            <td>
                                                <a href="include/actionTestStatus.jsp?id=<%=rss.getString(1)%>&<%if(rss.getBoolean(5) == true){%>display=false<% } else {%>display=true<% } %>">
                                                 <%
                                                if(rss.getBoolean(5) == true)
                                                {
                                                %>
                                                <img src="images/preview_f2.png" height="20" width="20" border="0"/>
                                                <% } else {
                                                %> <img src="images/unpreview_f2.png" height="20" width="20" border="0"/><% } %>
                                                </a>
                                                
                                            </td>
                                            <td>
                                                <ajax:anchors target="updateTest" >
                                                    <a href="include/updateTest.jsp?id=<%=rss.getString(1)%>&TestName=<%=rss.getString(3)%>&TimeTest=<%=rss.getString(4)%>" >Edit</a>
                                                </ajax:anchors>
                                            </td>
                                            
                                        </tr>
                                        <% }%>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>
